<script>
import { formatMoney } from '../../utils/number'

export default {
  name: 'BiMoneyFormat',
  functional: true,
  props: {
    /**
     * 实际金额是分单位
    */
    value: {
      type: Number
    },
    unit: {
      type: String,
      default: '元'
    }
  },
  render (h, c) {
    const value = formatMoney(c.props.value)
    return h('span', {
      class: 'bi-money-format'
    }, [value + (c.props.unit || '')])
  }
}
</script>
<style lang="less">
.bi-money-format {
  color: #f3a73f;
}
</style>